package com.cwnu.onlinemall.service;

import com.cwnu.onlinemall.mapper.MallFinanceMapper;
import com.cwnu.onlinemall.pojo.MallFinance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FinanceServiceImpl implements FinanceService {
    @Autowired
    MallFinanceMapper mallFinanceMapper;

    @Override
    public Integer updateById(MallFinance mallFinance) {
        return mallFinanceMapper.updateByPrimaryKeySelective(mallFinance);
    }

    @Override
    public Integer deleteById(Integer id) {
        return mallFinanceMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<MallFinance> selectAll() {
        return mallFinanceMapper.selectByExample(null);
    }

    @Override
    public MallFinance selectById(Integer id) {
        MallFinance mallFinance = mallFinanceMapper.selectByPrimaryKey(id);
        return mallFinance;
    }

    @Override
    public Integer insert(MallFinance mallFinance) {
        int insertRow = mallFinanceMapper.insertSelective(mallFinance);
        return insertRow;
    }
}
